From 8f5278eb443864910dd9c2131c992d71e3af2d20 Mon Sep 17 00:00:00 2001 From: kartofen Date: Fri, 26 Aug 2022 23:54:17 +0300 Subject: Big bang --- src/pages/board/[board].astro | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/pages/board/[board].astro (limited to 'src/pages/board/[board].astro') diff --git a/src/pages/board/[board].astro b/src/pages/board/[board].astro new file mode 100644 index 0000000..2624fed --- /dev/null +++ b/src/pages/board/[board].astro @@ -0,0 +1,26 @@ +--- +import Default from '../../layouts/Default.astro'; +import Thread from '../../components/Thread.svelte' +import type Thread from '../../models/Thread'; + +import { api } from '../../lib/api.ts'; +import { processThreadIn } from '../../lib/thread' + +const { board } = Astro.params; +const data = await api('get', `board/${board}`); + +if(data.status === 404) return Astro.redirect('/404'); + +const threads: Thread[] = await data.json(); +for(let thread of threads) + await processThreadIn(board, thread); +--- + + +

{board}

+ + {threads.map((thread) => ( + + ))} + +
-- cgit v1.2.3